package chapter10;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/4/13 13:14
 */
public class Parcel4 {
    public Destination destination(String s) {
        return new PDestenction(s);
    }

    public Contents contents() {
        return new PContents();
    }

    private class PContents implements Contents {
        private int i = 11;

        @Override
        public int value() {
            return i;
        }
    }

    protected class PDestenction implements Destination {
        private String label;

        public PDestenction(String label) {
            this.label = label;
        }

        @Override
        public String readLabel() {
            return label;
        }
    }
}
